/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package jp.co.irep.juten.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author toan_nguyen
 */
@Embeddable
public class MakerPrefecturePK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "maker_id")
    private int makerId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "prefecture_id")
    private int prefectureId;

    public MakerPrefecturePK() {
    }

    public MakerPrefecturePK(int makerId, int prefectureId) {
        this.makerId = makerId;
        this.prefectureId = prefectureId;
    }

    public int getMakerId() {
        return makerId;
    }

    public void setMakerId(int makerId) {
        this.makerId = makerId;
    }

    public int getPrefectureId() {
        return prefectureId;
    }

    public void setPrefectureId(int prefectureId) {
        this.prefectureId = prefectureId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) makerId;
        hash += (int) prefectureId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MakerPrefecturePK)) {
            return false;
        }
        MakerPrefecturePK other = (MakerPrefecturePK) object;
        if (this.makerId != other.makerId) {
            return false;
        }
        if (this.prefectureId != other.prefectureId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jp.co.irep.tech.juten.jpa.entity.MakerPrefecturePK[ makerId=" + makerId + ", prefectureId=" + prefectureId + " ]";
    }
    
}
